home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / te2_130t.zip / TE2INST.006 / Script.Doc next >
Text File  |  1994-04-08  |  75KB  |  1,556 lines

  1.                                                 TE/2 Script Language
  2.                                                     Function Listing
  3.                                                       11 April, 1994
  4.  
  5.                                                      Oberon Software
  6.                                                1405 East Main Street
  7.                                               Mankato, MN 56001-5070
  8.  
  9.  
  10.   -------------------------------------------------------------
  11.  
  12. Copyright 1990-94, Oberon Software, Mankato, MN - All Rights Reserved
  13.  
  14.   -------------------------------------------------------------
  15.  
  16.  
  17.  
  18.      ----------------------------------------------------
  19.  
  20. Notice:  Information in this document is subject to change without
  21. notice and does not constitute a commitment on the part of Oberon
  22. Software.
  23.  
  24.      ----------------------------------------------------
  25.  
  26.  
  27.     ABS(integer)
  28.         Returns: INTEGER, the absolute value of its argument
  29.  
  30.  
  31.     ASCIIVAL(string)
  32.         Returns: INTEGER, the ASCII value of the first character of
  33.                           its argument
  34.  
  35.  
  36.     ATOI(string)
  37.         Returns: INTEGER, the numeric value of the argument
  38.         Notes:  this function understands hex and octal notation,
  39.                 thus ATOI("27") and ATOI("0x1b") and ATOI("033")
  40.                 all return the same value, 27.
  41.  
  42.  
  43.     BEEP(integer, integer)
  44.         Returns: INTEGER, always TRUE
  45.         Notes:  this function will sound the console beeper, the
  46.                 first parameter specifies the frequency (pitch) of
  47.                 the sound, the second the duration.
  48.  
  49.  
  50.     CANCELWATCH(integer)
  51.         Returns: INTEGER, TRUE or FALSE
  52.         Notes:  The argument must be a 'watch handle' created via a
  53.                 previous call to WATCHFOR.  This function releases
  54.                 the watch.  It returns FALSE if the watch did not
  55.                 exist, TRUE otherwise.
  56.                 See also WATCHFOR.
  57.  
  58.     CHAT(void)
  59.         Returns: INTEGER, always TRUE
  60.         Notes:  Activates chat mode, same as Alt-G from terminal mode
  61.  
  62.  
  63.     CHDIR(string)
  64.         Returns: INTEGER, TRUE or FALSE
  65.         Notes:  the argument specifies a subdirectory, this function
  66.                 will attempt to change the current working directory
  67.                 on the current or specified disk, it will NOT change
  68.                 the currently logged disk however.  CHDIR returns
  69.                 TRUE if it was successful. (See CHDISK)
  70.         Examples:
  71.                 CHDIR("D:\")
  72.                 CHDIR("\comm\log")
  73.  
  74.  
  75.     CHDISK(string)
  76.         Returns: INTEGER, TRUE or FALSE
  77.         Notes:  the first character of the argument should specify a
  78.                 disk letter.  This function will attempt to make that
  79.                 the current drive.  It returns TRUE if it was
  80.                 successful. (See CHDIR)
  81.  
  82.  
  83.     CLOSEDIALOG(integer)
  84.         Returns: INTEGER, always TRUE
  85.         Notes:  The argument MUST be a handle to a dialog that has
  86.                 been created by an earlier call to OPENDIALOG.
  87.                 Restores the area of the screen which was saved during
  88.                 the OPENDIALOG call and frees up all memory associated
  89.                 with this dialog.
  90.  
  91.  
  92.     CLS(void)
  93.         Returns: INTEGER, always TRUE
  94.         Notes:  Clears the terminal screen to the current attribute.
  95.  
  96.  
  97.     CRC16(string, integer)
  98.         Returns: INTEGER
  99.         Notes: The numeric parameter specifies the how many bytes of
  100.                the string to consider, if set to -1 then the entire
  101.                string is used.  The function returns the 16-bit CRC
  102.                for the string.
  103.  
  104.     CRC32(string, integer)
  105.         Returns: INTEGER
  106.         Notes: The numeric parameter specifies the how many bytes of
  107.                the string to consider, if set to -1 then the entire
  108.                string is used.  The function returns the 32-bit CRC
  109.                for the string.
  110.  
  111.     DIAL(string OR integer)
  112.         Returns: INTEGER, TRUE or FALSE
  113.         Notes:  If the argument is an integer or if it is a string
  114.                 with the format "#nnn" where the n's are digits, DIAL
  115.                 will attempt to dial the indicated entry in the
  116.                 current dialing directory.  If it is a string and
  117.                 not "#nnn" format, then if the first character is a
  118.                 digit it will manually dial the string, else if the
  119.                 string is not empty it will search for a TAG in the
  120.                 current dialing directory that matches and dial that
  121.                 entry.  If the string is empty, the user is prompted
  122.                 for a number (this is equivalent to typing Alt-M from
  123.                 terminal mode).  DIAL returns TRUE if a connection
  124.                 was made.
  125.  
  126.  
  127.     DIRECTORY(void)
  128.         Returns: INTEGER, TRUE or FALSE
  129.         Notes:  This is equivalent to typing Alt-D from terminal
  130.                 mode.  DIRECTORY returns TRUE if a connection was
  131.                 made.
  132.  
  133.  
  134.     DIRNAME(string)
  135.         Returns: STRING
  136.         Notes:  The parameter is either a "tag" to search for in
  137.                 the currently loaded dialing directory, "#nnn" where "nnn"
  138.                 is an entry's position in the directory, or it may be
  139.                 "" in which case it refers to the most recently dialed
  140.                 entry.  Returns the value of the "Name" field in the
  141.                 specified entry or "" if it could not be located.
  142.  
  143.     DIRPHONE(string)
  144.         Returns: STRING
  145.         Notes:  The parameter is either a "tag" to search for in
  146.                 the currently loaded dialing directory, "#nnn" where "nnn"
  147.                 is an entry's position in the directory, or it may be
  148.                 "" in which case it refers to the most recently dialed
  149.                 entry.  Returns the value of the "Number" field in the
  150.                 specified entry or "" if it could not be located.
  151.  
  152.     DIRSCRIPT(string)
  153.         Returns: STRING
  154.         Notes:  The parameter is either a "tag" to search for in
  155.                 the currently loaded dialing directory, "#nnn" where "nnn"
  156.                 is an entry's position in the directory, or it may be
  157.                 "" in which case it refers to the most recently dialed
  158.                 entry.  Returns the value of the "Script" field in the
  159.                 specified entry or "" if it could not be located.
  160.  
  161.     DIRTAG(string)
  162.         Returns: STRING
  163.         Notes:  The parameter is either a "tag" to search for in
  164.                 the currently loaded dialing directory, "#nnn" where "nnn"
  165.                 is an entry's position in the directory, or it may be
  166.                 "" in which case it refers to the most recently dialed
  167.                 entry.  Returns the value of the "Tag" field in the
  168.                 specified entry or "" if it could not be located.
  169.  
  170.     DOWNLOAD(special, string)
  171.         Returns: INTEGER, TRUE or FALSE
  172.         Notes:  The "special" parameter must be one of the following
  173.                 pre-defined constants: XMODEM, XMODEM1K, YMODEM,
  174.                 YMODEMG, ZMODEM, or QUERY.  If this parameter is
  175.                 QUERY, the user is prompted for the protocol.  The
  176.                 second parameter is the file name, if it is the empty
  177.                 string, XMODEM and XMODEM1K will prompt the user for
  178.                 the filename, this parameter is ignored by YMODEM,
  179.                 YMODEMG, and ZMODEM.
  180.                 The function returns TRUE if the file transfer ended
  181.                 with no fatal errors.  (See UPLOAD)
  182.  
  183.  
  184.     DRAWBOX(integer, integer, integer, integer, integer, integer, integer)
  185.         Returns: INTEGER, TRUE (success) or FALSE (error)
  186.         Notes:  The parameters are, in order:
  187.                   Row       - 1 to ScreenLines
  188.                   Col       - 1 to ScreenCols
  189.                   NumRows   - 1 to ScreenLines
  190.                   NumCols   - 1 to ScreenCols
  191.                   Attribute - 0 to 255, any valid color attribute
  192.                   Style     - 0:No frame, 1:single lines, 2:double lines
  193.                   Fill      - TRUE or FALSE
  194.  
  195.     DUMPINIT(void)
  196.         Returns: INTEGER, always TRUE
  197.         Notes:  Prints the current value of all the system-global
  198.                 values settable via TE2.INI to the terminal screen.
  199.  
  200.  
  201.     EMULATE(special)
  202.         Returns: INTEGER, the new emulation.
  203.         Notes:  The "special" parameter must be one of the following
  204.                 pre-defined constants: TTY, ANSI_BBS, ANSI_TE2,
  205.                 VT100, or QUERY.  If it is QUERY, the user is
  206.                 prompted for the emulation.
  207.  
  208.  
  209.     ERASE(string)
  210.         Returns: INTEGER, 0 on success, -1 on error
  211.         Notes:  This function will delete the indicated file from
  212.                 the disk.  Clearly, you should use this function
  213.                 with care.
  214.  
  215.     ERRORMSG(string, string)
  216.         Returns: INTEGER, always TRUE
  217.         Notes:  Displays the error message dialog (TE/2 uses this
  218.                 dialog for most all, non-script related errors).
  219.                 String1 is left justified on the first line of the
  220.                 dialog, string2 centered on the second and "Strike
  221.                 any key to continue" is placed at the bottom of the
  222.                 dialog.  ErrorAttr from the initialization file is
  223.                 used for the dialog color.  The portion of the screen
  224.                 overlaid by the dialog is saved and restored when the
  225.                 dialog is exited.
  226.  
  227.  
  228.     EXECPGM(string, string, string, integer, integer)
  229.         Returns: INTEGER
  230.         Notes:  The arguments are, in order, session_title, program_name,
  231.                 program_args, exec_type, and exec_flags.  These parameters
  232.                 map directly to the information contained in the external
  233.                 program file that TE/2 uses to build the "User Programs"
  234.                 menu (Alt-J), you should refer to the TE/2 Manual for
  235.                 more information on these settings.  All of the functionality
  236.                 for user input and global value passing that is referred
  237.                 to there is present here.  The exec_flags parameter is NOT
  238.                 optional for this call like it is in the external programs
  239.                 file however.
  240.                 The return value of EXECPGM() depends on the mode in which
  241.                 the child process was executed.  A return value of -1 will
  242.                 usually indicate an invalid parameter list.  If the child
  243.                 was executed in the background or in a new session, the
  244.                 return value is zero for success or the error code which
  245.                 was returned by OS/2.  If the child was executed as a
  246.                 foreground process, the return value is the exit code of
  247.                 the child program (i.e., the value which it passed to
  248.                 DosExit()).
  249.  
  250.  
  251.     EXIT(special)
  252.         Returns: INTEGER, TRUE or FALSE
  253.         Notes:  The "special" parameter must be one of the following
  254.                 pre-defined constants: TRUE, FALSE, IFCARRIER.  If it
  255.                 is FALSE, the user will be asked for confirmation
  256.                 before exiting, if TRUE TE/2 will unconditionally
  257.                 exit, if QUERY the user will be queried only if the
  258.                 carrier is high (TE/2 is online).
  259.                 The function returns TRUE if TE/2 is exiting
  260.                 (although you won't be able to test this, if the
  261.                 function returns to the script at all it should do so
  262.                 with FALSE).
  263.  
  264.  
  265.     FNKEY(integer)
  266.         Returns: INTEGER, TRUE or FALSE
  267.         Notes:  If the argument is zero or greater than 48, the
  268.                 function key menu is activated, this is equivalent
  269.                 to typing Alt-K from terminal mode.  If it is a
  270.                 number from 1 to 48, the corresponding function key
  271.                 macro is transmitted.
  272.                         1 - 12  -> unshifed function keys 1-12
  273.                        13 - 24  -> shifted function keys 1-12
  274.                        25 - 36  -> control-function keys 1-12
  275.                        37 - 48  -> alt-function keys 1-12
  276.                 The function returns TRUE if a macro was transmitted.
  277.  
  278.  
  279.     FCLOSE(integer)
  280.         Returns:  INTEGER, TRUE or FALSE
  281.         Notes:  The argument should be the value returned from an
  282.                 earlier call to FOPEN (see notes on file handling).
  283.                 This function returns TRUE if the file was
  284.                 successfully closed.
  285.  
  286.  
  287.     FEOF(integer)
  288.         Returns:  INTEGER, TRUE or FALSE
  289.         Notes:  The argument should be the value returned from an
  290.                 earlier call to FOPEN (see notes on file handling).
  291.                 This function returns TRUE if the current file
  292.                 pointer position is at the end of file.
  293.  
  294.  
  295.     FERROR(integer)
  296.         Returns:  INTEGER, error code
  297.         Notes:  The argument should be the value returned from an
  298.                 earlier call to FOPEN (see notes on file handling).
  299.                 This function returns FALSE if no error has occurred
  300.                 accessing the indicated file, else it is an error
  301.                 code.
  302.  
  303.  
  304.     FGETC(integer)
  305.         Returns:  INTEGER, character code or -1
  306.         Notes:  The argument should be the value returned from an
  307.                 earlier call to FOPEN (see notes on file handling).
  308.                 This function returns the next character in a file
  309.                 which has been opened for input.  A -1 result is
  310.                 used to indicate end-of-file or error (See FEOF and
  311.                 FERROR).
  312.  
  313.  
  314.     FGETS(integer)
  315.         Returns:  STRING, input from file
  316.         Notes:  The argument should be the value returned from an
  317.                 earlier call to FOPEN (see notes on file handling).
  318.                 This function reads a line of text from a file opened
  319.                 for input.  It reads all characters up to and
  320.                 including a newline character ("^J", see notes on
  321.                 file handling for information about newline
  322.                 translation) or 1024 characters, whichever occurs
  323.                 first. It returns and empty string to indicate
  324.                 end-of-file or error (See FEOF and FERROR).
  325.  
  326.  
  327.     FOPEN(string, string)
  328.         Returns: INTEGER, file handle
  329.         Notes:  This function MAY NOT be called outside the context
  330.                 of and assignment statement.  It opens a file and
  331.                 its return value is a "handle" for all the other
  332.                 file oriented functions (FGETC, FEOF, FCLOSE, etc).
  333.                 Care should be taken with this value so that it not
  334.                 altered in any way until FCLOSE has safely been
  335.                 called.
  336.                 The first argument is a file name, the second is the
  337.                 open "mode" and should be one of "r", "w", "a", "rt",
  338.                 "rb", "wt", "wb", "at", "ab", "r+t", "w+t", "a+t",
  339.                 "r+b", "w+b", or "a+b" (see notes on file handling
  340.                 for an explanation).
  341.                 If the function returns 0, the file was not opened.
  342.  
  343.  
  344.     FPUTC(integer, integer)
  345.         Returns:  INTEGER, the output character or -1
  346.         Notes:  The second argument should be the value returned from
  347.                 an earlier call to FOPEN (see notes on file handling).
  348.                 The first argument is the ascii value of the
  349.                 character to be output to the file, the file must
  350.                 have been opened in a mode which allows writing of
  351.                 data ("w", "a", etc).  A return value of -1 indicates
  352.                 an error situation (see FEOF and FERROR).
  353.  
  354.  
  355.     FPUTS(string, integer)
  356.         Returns:  INTEGER, the last output character or -1
  357.         Notes:  The second argument should be the value returned from
  358.                 an earlier call to FOPEN (see notes on file handling).
  359.                 The first argument is the string to write to the file.
  360.                 The file must have been opened in a mode which allows
  361.                 writing of data ("w", "a", etc).  A return value of
  362.                 -1 indicates an error (see FEOF and FERROR).
  363.  
  364.  
  365.     FSEEK(integer, integer, special)
  366.         Returns:  INTEGER, TRUE or FALSE
  367.         Notes:  The first argument should be the value returned from
  368.                 an earlier call to FOPEN (see notes on file handling).
  369.                 The second integer specifies an offset into the file
  370.                 which may be positive, negative, or zero depending
  371.                 upon the mode specified in the third argument.
  372.                 This function will attempt to move the current file
  373.                 location pointer in the indicated file to a number
  374.                 of bytes (specified in the second argument) from the
  375.                 origin (specified in the third argument).  The third
  376.                 argument MUST be one of:
  377.                         0 -- beginning of file
  378.                         1 -- current position in file
  379.                         2 -- end of file
  380.                 If this function returns false, an error has occurred.
  381.                 (see FEOF and FERROR)
  382.  
  383.  
  384.     FTELL(integer)
  385.         Returns:  INTEGER, 
  386.         Notes:  The argument should be the value returned from an
  387.                 earlier call to FOPEN (see notes on file handling).
  388.                 This function retrieves the current location pointer
  389.                 in the indicated file.  A return value of -1
  390.                 indicates an error (see FOEF and FERROR).
  391.  
  392.  
  393.     GETC(void)
  394.         Returns: INTEGER, keystroke value or zero
  395.         Notes:  Waits for the user to type a key and returns the value
  396.                 of the keystroke.  If an error occurred, the return
  397.                 is zero, if it was a 'standard' key, the return is
  398.                 the ASCII value of the keystroke, if it was an
  399.                 'extended' key (i.e., Alt key or function key) it
  400.                 returns the scan code of the key times 256.  The
  401.                 keystroke is NOT echoed to the terminal screen.
  402.                 (See GETS)
  403.  
  404.  
  405.     GETENV(string)
  406.         Returns: STRING
  407.         Notes:  This function will scan the OS/2 environment table
  408.                 for the current process (TE/2) and retrieve the value
  409.                 associated with the string specified in its argument
  410.                 or the empty string if the argument was not found in
  411.                 the environment.
  412.         Examples:
  413.                 CmdExe = GETENV("COMSPEC")
  414.                 MESSAGE("%s", GETENV("PROMPT"))
  415.  
  416.  
  417.     GETYESNO(string, string, integer)
  418.         Returns: INTEGER, User selection result
  419.         Notes:  Displays the Yes/No dialog (TE/2 uses this dialog
  420.                 for querying the user for hangup and exit).  Both
  421.                 strings are centered in the dialog, string2 may be
  422.                 NULL.  The integer determines the default answer
  423.                 (TRUE for Yes, FALSE for No). DLogNormAttr and
  424.                 DLogHiAttr from the initialization file are used for
  425.                 the dialog colors. The portion of the screen overlaid
  426.                 by the dialog are saved and restored when the dialog
  427.                 is exited.
  428.                 Returns TRUE if "Yes" was selected, FALSE if "No" was
  429.                 selected.
  430.  
  431.  
  432.     GETS(integer)
  433.         Returns: STRING
  434.         Notes:  Gets a string from the console at the current cursor
  435.                 location.  The argument specifies the maximum length
  436.                 of the string, it may be a number from 1 to 255.  If
  437.                 it is less than one, an empty string is immediately
  438.                 returned, if it is greater than 255, it is treated as
  439.                 if it were 255.  GETS retrieves a string from the
  440.                 user up to, but not including the first carriage
  441.                 return character or the maximum length whichever
  442.                 occurs first.  Backspace will erase the previous
  443.                 character typed (if any) and the ESCape key will
  444.                 immediately terminate the input and GETS will return
  445.                 an empty string.  If terminal display is turned on
  446.                 (see TERMECHO) the input is echoed to the terminal
  447.                 screen in the current attribute and at the current
  448.                 cursor location.  (See GETC)
  449.  
  450.  
  451.     HANGUP(special)
  452.         Returns: INTEGER, TRUE or FALSE
  453.         Notes:  The "special" argument must be one of TRUE, FALSE, or
  454.                 IFCARRIER.  If FALSE, the hangup sequence will be
  455.                 unconditionally performed, if TRUE the user will be
  456.                 queried for permission, if IFCARRIER, the user will
  457.                 be queried only if the carrier is high (TE/2 is
  458.                 online).  The function returns TRUE if the hangup
  459.                 sequence was successfully transmitted and TE/2 is
  460.                 no longer on line.
  461.                 NOTE: The parameter for the HANGUP() statement will
  462.                   override the current setting of the TE/2 QueryHangUp
  463.                   initialization variable.
  464.  
  465.  
  466.     INTERPRET(string)
  467.         Returns: INTEGER, always TRUE
  468.         Notes:  Invokes the script parser on its argument and executes it
  469.                 as a script command.  Anything that can be typed at the
  470.                 "Command:" prompt can be executed via Interpret().
  471.         Examples:
  472.                 INTERPRET("hangup(false)")
  473.                 INTERPRET("downloadpath = ""d:\foo""")
  474.  
  475.  
  476.     ITOA(integer, special)
  477.         Returns: STRING, ASCII representation of the argument
  478.         Notes:  The "special" argument must be in the range 2-36,
  479.                 it specifies the radix for the conversion (number
  480.                 system base.  If the radix is 10 and the value of
  481.                 the first argument is negative, a leading '-' sign
  482.                 is the first character of the result.
  483.         Examples:
  484.                 ITOA(1234, 10) returns "1234"
  485.                 ITOA(8, 2)     returns "1000"
  486.  
  487.  
  488.     JDATE(integer, integer)
  489.         Returns:  INTEGER, A packed date (in the same format as the
  490.                   'date' read-only variable) based on the given Julian
  491.                   day number in the first parameter. Returns 0 on error.
  492.         Notes:  The first parameter is the Julian Day Number to
  493.                 translate, the second is a Boolean switch.  If the
  494.                 second parameter is TRUE, the returned date will be
  495.                 relative to the Gregorian Calendar otherwise it will
  496.                 be relative to the Julian Calendar.  If the Julian
  497.                 Day Number is invalid or the results would be out of
  498.                 bounds for the requested calendar, the return value
  499.                 will be 0. (See discussion on Julian date conversions
  500.                 elsewhere in this document.)
  501.  
  502.  
  503.     JULIAN(integer, integer)
  504.         Returns:  INTEGER, Julian Day Number or -1 on error.
  505.         Notes:  The first parameter must be a packed date in the same
  506.                 format as the 'date' read-only variable.  The second
  507.                 parameter indicates which calendar to use when
  508.                 translating the date: TRUE means that this is a
  509.                 Gregorian date, FALSE implies a Julian date.  The
  510.                 return value is the Julian Day Number for the given
  511.                 date.  If the date is invalid for the indicated
  512.                 calendar, this function returns -1. (See discussion
  513.                 on Julian date conversions elsewhere in this
  514.                 document.)
  515.  
  516.  
  517.     JULIAN2(integer, integer, integer, integer)
  518.         Returns:  INTEGER, Julian Day Number or -1 on error.
  519.         Notes:  The parameters are, in order: month number (1 to 12),
  520.                 day number (1 to 31), year number, and a Boolean to
  521.                 indicate which calendar to use when translating this
  522.                 date: TRUE means that this is a Gregorian date, FALSE
  523.                 inplies a Julian Date.  The return value is the Julian
  524.                 Day Number for the given date.  If the date is invalid
  525.                 for the indicated calendar, this function returns -1.
  526.                 (See discussion on Julian date conversions elsewhere in
  527.                 this document.)
  528.  
  529.  
  530.     JWDAY(integer)
  531.         Returns: INTEGER, weekday index (0 to 6) or -1 on error.
  532.         Notes:  The single parameter is a Julian Day Number, the
  533.                 function will return the weekday index for that
  534.                 Julian Day (0 is Sunday).  If the Julian Day number
  535.                 is invalid, the function returns -1.
  536.  
  537.  
  538.     LFAFTERCR(special)
  539.         Returns: INTEGER, TRUE or FALSE, the new value of LFafterCR
  540.         Notes:  The "special" parameter must be one of TRUE, FALSE,
  541.                 or TOGGLE.  If TRUE or FALSE, the value of the
  542.                 LF-After-CR flag is set to that value, if it is
  543.                 TOGGLE the flag becomes TRUE if it was FALSE and
  544.                 vice-versa.
  545.  
  546.  
  547.     LOCALECHO(special)
  548.         Returns: INTEGER, TRUE or FALSE, the new value of LocalEcho
  549.         Notes:  The "special" parameter must be one of TRUE, FALSE,
  550.                 or TOGGLE.  If TRUE or FALSE, the value of the
  551.                 Local-Echo flag is set to that value, if it is
  552.                 TOGGLE the flag becomes TRUE if it was FALSE and
  553.                 vice-versa.
  554.  
  555.  
  556.     LOGCLOSE(void)
  557.         Returns: INTEGER, TRUE or FALSE
  558.         Notes:  Closes the currently open log file and returns TRUE,
  559.                 if there is no currently open log file no action is
  560.                 performed and the function returns FALSE.
  561.  
  562.  
  563.     LOGFILE(void)
  564.         Returns: INTEGER, TRUE or FALSE
  565.         Notes:  This is equivalent to typing Alt-L in terminal mode.
  566.                 If a log file is currently open this function will
  567.                 close it and return TRUE, else the user will be
  568.                 prompted for a log file name to open.  In this case
  569.                 it returns TRUE if a log file was opened or FALSE if
  570.                 the user typed ESCape at the prompt of if there was
  571.                 an error opening the file.
  572.  
  573.  
  574.     LOGOPEN(string, integer)
  575.         Returns: INTEGER, TRUE or FALSE
  576.         Notes:  The first argument specifies the log file to open.
  577.                 This must contain the entire path/name of the file,
  578.                 default logpath handling is NOT performed on this
  579.                 string.  The second argument should be TRUE if the
  580.                 the log file should overwrite any existing file of
  581.                 the same name, if FALSE, new data will be appended
  582.                 to the file.
  583.                 If the first argument is NULL, the user will be
  584.                 prompted for the file name and overwrite/append mode,
  585.                 the second parameter is ignored.
  586.                 The function returns TRUE is a log file was
  587.                 successfully opened, FALSE if the file was not opened
  588.                 due to error or user intervention.
  589.  
  590.  
  591.     LOGPAUSE(special)
  592.         Returns: INTEGER, TRUE or FALSE
  593.         Notes:  The "special" argument must be one of TRUE, FALSE, or
  594.                 TOGGLE.  If TRUE, the log file will be placed in the
  595.                 paused state, if FALSE it will be made active, if
  596.                 TOGGLE it will alternate states.  The function
  597.                 returns TRUE if an action was performed, if there is
  598.                 no currently open log file, it will return FALSE.
  599.  
  600.  
  601.     MAINMENU(special)
  602.         Returns: INTEGER, TRUE or FALSE
  603.         Notes:  The "special" argument must be one of -1, 0, 1, or 2
  604.                 with the following meanings:
  605.                    -1 -> Cycle menu state
  606.                     0 -> Turn OFF Menu or Status bar
  607.                     1 -> Turn ON Menu
  608.                     2 -> TURN ON Status bar
  609.                 The function returns TRUE if the menu state was changed.
  610.                 Note that the system-global variable "MenuActive" may be
  611.                 examined to determine the current state of the menu.
  612.  
  613.  
  614.     MESSAGE(string, ... )
  615.         Returns: INTEGER, the length of the message string
  616.         Notes:  MESSAGE takes a parameter list identical to the
  617.                 SPRINTF function, refer to SPRINTF for a more
  618.                 complete discussion of the format string and its
  619.                 arguments.  This function will build a string
  620.                 according to the rules for SPRINTF and display it
  621.                 on the terminal screen at the current cursor
  622.                 location.
  623.  
  624.  
  625.     MUXWAIT(string, integer)
  626.         Returns: INTEGER
  627.         Notes:  Very much like the related WAITFOR function, MUXWAIT
  628.                 allows you to specify, in the its first argument, as
  629.                 many as 10 strings to wait for.  The first character
  630.                 of the string argument defines the delimiter that
  631.                 will be in effect for parsing the seperate wait
  632.                 strings.  This may be any character you choose bit it
  633.                 should be a character that does not otherwise appear
  634.                 in any of the substrings (see the examples). MUXWAIT
  635.                 does not return until one of the specified strings
  636.                 has been encountered at the comm port, the duration
  637.                 in seconds specified in the second argument has
  638.                 elapsed, or the user types ESCape, whichever occurs
  639.                 first.  Returns the index of the string which was
  640.                 found or FALSE if a timeout occured or the wait was
  641.                 aborted by typing ESCape.
  642.                 Incoming characters are echoed to the terminal screen
  643.                 unless terminal display is turned off, the log file
  644.                 is maintained.  (See WAITFOR, WATCHFOR)
  645.                 If the second parameter is less than zero, normal
  646.                 timeout processing is disabled and MUXWAIT will not
  647.                 return until a string has been matched or an ESCape
  648.                 is typed at the keyboard.
  649.         Examples:
  650.                 MUXWAIT("/ENTER to continue/Select:/", 60)
  651.                         The above example will wait up to 60 seconds
  652.                         for either the string "ENTER to continue" or
  653.                         "Select:" to appear at the comm port.  If,
  654.                         for instance, "Select:" was encountered, the
  655.                         function returns 2.
  656.                 MUXWAIT("!Enter name/userid:!What system?!", 30)
  657.                         Note the use of "!" as the delimiter in this
  658.                         example rather than the "/" used in the
  659.                         first.  This example needs to use the slash
  660.                         as a valid character in one of its searches
  661.                         thus the different delimiter is mandated.
  662.  
  663.  
  664.     OPENDIALOG(integer, integer, integer, integer, integer)
  665.         Returns: INTEGER, handle to created dialog
  666.         Notes:  Creates a dialog box on screen complete with frame
  667.                 and shadow.  The arguments are, in order, top row,
  668.                 left column, bottom row, right column, and color
  669.                 attribute.  The contents of the portion of the screen
  670.                 overlaid by the dialog box are saved and will be
  671.                 restored with a subsequent call to CLOSEDIALOG.
  672.                 The return value is a 'handle' to the dialog.
  673.  
  674.  
  675.     PARMSMNU(void)
  676.         Returns: INTEGER, always FALSE
  677.         Notes:  This is equivalent to typing Alt-P from terminal
  678.                 mode.  The system-global variables "Device", "Port",
  679.                 "Baud", "WordLen", and "StopBits" may be examined
  680.                 to determine the current line settings at any time.
  681.  
  682.  
  683.     PASSWORD(string)
  684.         Returns: STRING
  685.         Notes:  The parameter is either a "tag" to search for in
  686.                 the currently loaded dialing directory, "#nnn" where "nnn"
  687.                 is an entry's position in the directory, or it may be
  688.                 "" in which case it refers to the most recently dialed
  689.                 entry.  Returns the value of the "Password" field in the
  690.                 specified entry or "" if it could not be located.
  691.  
  692.     PGMMENU(void)
  693.         Returns: INTEGER, always TRUE
  694.         Notes:  This is equivalent to typing Alt-J in terminal mode.
  695.  
  696.  
  697.     PLAYFILE(string, integer)
  698.         Returns: INTEGER, 0 if no error or an error value
  699.         Notes: The string parameter should be the name of an MMOS2
  700.                "playable" file (.WAV, .VOC, etc).  The integer parameter
  701.                should be set to TRUE is you wish the PLAYFILE function
  702.                to wait until MMOS2 is finished playing the file before
  703.                returning or FALSE if you wish asychronous play.  In
  704.                asychronous mode, PLAYFILE always returns 0.  This function
  705.                is only valid if MMOS2 is installed on the system.
  706.                (See RECORDFILE)
  707.  
  708.  
  709.     POPKEYBOARD(void)
  710.         Returns: INTEGER, TRUE or FALSE
  711.         Notes: "Pops" a keyboard definition that was previously "pushed"
  712.                via PUSHKEYBOARD() and makes it the current keyboard.  The
  713.                old current keyboard is discarded.  Returns TRUE if
  714.                successful, FALSE if the stack was empty.  (See PUSHKEYBOARD,
  715.                READKEYFILE, QUERYKEYFILE)
  716.  
  717.  
  718.     PUSHKEYBOARD(void)
  719.         Returns: INTEGER, TRUE or FALSE
  720.         Notes: "Pushes", or saves, the current keyboard definition on
  721.                an internal stack for later retrieval via POPKEYBOARD().
  722.                The current keyboard definition is then set to all
  723.                default keystroke values.  Returns TRUE if successful or
  724.                FALSE if an error occured.  (See POPKEYBOARD, READKEYFILE,
  725.                QUERYKEYFILE)
  726.  
  727.  
  728.     QUERYKEYFILE(void)
  729.         Returns: STRING
  730.         Notes: Returns the name of the currently loaded key mapping file
  731.                (loaded via "KeyMapFile" in TE2.INI or the READKEYFILE()
  732.                function) or the empty string if the default keyboard is
  733.                in effect.  (See POPKEYBOARD, PUSHKEYBOARD, READKEYFILE)
  734.  
  735.  
  736.     QUEUEDIAL(void)
  737.         Returns: INTEGER, TRUE or FALSE
  738.         Notes:  This is equivalent to typing Alt-Q in terminal mode
  739.                 or "Q" in the dialing directory in that it activates
  740.                 the Queue Dialer.  The function returns TRUE if a
  741.                 connection resulted.
  742.  
  743.  
  744.     RESTART(integer)
  745.         Returns: INTEGER, TRUE or FALSE
  746.         Notes: Closes and reopens the current "Device".  If the integer
  747.                parameter is set to TRUE, the user will be prompted for
  748.                action after the device has been closed and before it is
  749.                reopened.  The user may elect to exit TE/2 at this point.
  750.                If set to FALSE, ReStart() procedes directly to the reopen
  751.                phase without prompting the user.  This function is not
  752.                available if TE/2 was started with a "hot" handle.  If
  753.                Restart() fails to reopen the device, usually TE/2 will
  754.                be exited.  If Telnet handshaking is enabled, it will be
  755.                reinitialized.  Returns TRUE on success and FALSE on
  756.                failure (if it returns from failure at all).
  757.  
  758.  
  759.     READKEYFILE(string)
  760.         Returns: INTEGER, TRUE or FALSE
  761.         Notes: The string parameter names a TE/2 Keyboard Definition File
  762.                presumably created via the TE2Kbd utility.  This function
  763.                reads the keyboard definition in the file into the current
  764.                TE/2 keyboard definition, overwriting the current definitions.
  765.                Returns TRUE on success, FALSE on FAILURE.  (See POPKEYBOARD,
  766.                PUSHKEYBOARD, QUERYKEYFILE)
  767.  
  768.  
  769.     READSCR(integer, integer, integer)
  770.         Returns: STRING
  771.         Notes:  The parameters are screen row, screen column, and number
  772.                 of bytes to read respecitvely.  Function returns a string
  773.                 containing the screen contents from the specified
  774.                 co-ordinates.
  775.  
  776.     RECORDFILE(string, string)
  777.         Returns: INTEGER, 0 on success or an error value
  778.         Notes: The first string parameter is the name of an output file
  779.                which will be created by MMOS2, the second string
  780.                parameter will the the title bar text for the recorder
  781.                window.  This function is only available if you have
  782.                MMOS2 installed on your system and may only be called if
  783.                TE/2 is running "in a window".  Furthermore, you should
  784.                have a microphone installed with your multimedia hardware
  785.                to successfully use this function.
  786.  
  787.  
  788.     REDIAL(void)
  789.         Returns: INTEGER, TRUE or FALSE
  790.         Notes:  This is equivalent to typing Alt-R in terminal mode in
  791.                 that the Redialer is activated.  The function returns
  792.                 TRUE is a connection resulted.
  793.  
  794.  
  795.     RENAME(string, string)
  796.         Returns: INTEGER, TRUE or FALSE
  797.         Notes:  This function will attempt to rename the file
  798.                 specified in the first argument to the new name given
  799.                 in the second argument.  The function returns TRUE if
  800.                 it was successful, otherwise an error has occurred.
  801.                 Further note, this function may be used to move a
  802.                 file from one subdirectory to another on the same
  803.                 disk but not across disks.
  804.         Examples:
  805.                 RENAME("logfile.log", "logfile.bak")
  806.                 RENAME("somefile.dat", "\safe\place\somefile.dat")
  807.  
  808.  
  809.     RESTORESCR(integer)
  810.         Returns: INTEGER, always TRUE
  811.         Notes:  The argument MUST be a handle to a saved screen that
  812.                 has been created via an earlier call to SAVESCR or
  813.                 disaster is sure to follow.  This function will restore
  814.                 a previously saved screen setup, restoring the video
  815.                 mode (if neccessary), cursor position, size, and
  816.                 attribute, and the entire contents of the screen and
  817.                 frees up all memory used by SAVESCR.
  818.  
  819.  
  820.     RGETC(integer, special)
  821.         Returns: INTEGER, received character or 0
  822.         Notes:  This function retrieves one byte of incoming data.
  823.                 The integer parameter specifies the timeout value in
  824.                 seconds.  If the timeout period elapses or the user
  825.                 types an ESCape at the console before a byte of
  826.                 information is received, RGETC returns 0.
  827.                 The second, special parameter determines how TE/2 will
  828.                 echo the character back to the sender.  It may be an
  829.                 integer or a string.  If it is an integer and is non-zero
  830.                 then the character will be echoed back to the sender,
  831.                 if it is zero, or if it is an empty or NULL string,
  832.                 no character is echoed.  Otherwise, the first character
  833.                 of the string is echoed back to the sender (use this
  834.                 for remote entry of passwords, for instance).
  835.                 Note that by specifying a number less than zero as the
  836.                 timeout parameter, timeout processing is disabled.
  837.                 Incoming characters are echoed to the terminal screen
  838.                 unless terminal display is turned off, the log file
  839.                 is maintained.
  840.                 Backspaces are processed and filtered by RGETS before
  841.                 returning, if echoing is enabled, backspaces,
  842.                 carriage returns, and line feeds are echoed as
  843.                 themselves regardless of any translation specified
  844.                 in parameter 2. (See RGETS)
  845.  
  846.  
  847.     RGETS(integer, integer, special)
  848.         Returns: STRING, the received data
  849.         Notes:  This function retrieves incoming data into a string
  850.                 variable up to the first carriage return or the
  851.                 string length specified in the first argument or
  852.                 until the number of seconds specified in the second
  853.                 argument has elapsed, or until the user types an
  854.                 ESCape character at the console, whichever occurs first. 
  855.                 The third, special parameter determines how TE/2 will
  856.                 echo the characters back to the sender.  It may be an
  857.                 integer or a string.  If it is an integer and is non-zero
  858.                 then the characters will be echoed back to the sender,
  859.                 if it is zero, or if it is an empty or NULL string,
  860.                 no characters are echoed.  Otherwise, the first character
  861.                 of the string is echoed back to the sender for each
  862.                 received character. (use this for remote entry of
  863.                 passwords, for instance).
  864.                 Note that by specifying a number less than zero as the
  865.                 timeout parameter, timeout processing is disabled.
  866.                 Incoming characters are echoed to the terminal screen
  867.                 unless terminal display is turned off, the log file
  868.                 is maintained.
  869.                 Backspaces are processed and filtered by RGETS before
  870.                 returning, if echoing is enabled, backspaces,
  871.                 carriage returns, and line feeds are echoed as
  872.                 themselves regardless of any translation specified
  873.                 in parameter 3.
  874.                 If the length parameter evaluates to 1, backspaces
  875.                 are NOT filtered or translated.
  876.                 (See RGETC)
  877.  
  878.  
  879.     RSHELL(string, string, integer)
  880.         Returns: INTEGER
  881.         Notes:  Similar in many ways to the SHELL function but subtly
  882.                 different in several important aspects.  The first string
  883.                 specifies a program to be executed, the second its arguments.
  884.                 The program argument MUST be specified, there is no default
  885.                 value.  When the program is executed, the standard input,
  886.                 standard output, and standard error system handles are all
  887.                 redirected to the comm port.  Thus, any program which takes
  888.                 its input from stdin and writes to stdout and/or stderr,
  889.                 will receive its input now from the comm port and send its
  890.                 output back out the comm port.
  891.                 If the third, integer parameter is non-zero TE/2 will
  892.                 continue to monitor the status of the connection while the
  893.                 child process is running.  If a loss of carrier is detected,
  894.                 the child program will be aborted and control will return
  895.                 to your script file.
  896.                 TE/2's screen wil be saved and cleared before executing the
  897.                 RSHELL program and restored upon return.
  898.                 The return value is -1 if there was an error otherwise it is
  899.                 the return code of the program.
  900.                 RSHELL processes incoming backspace characters
  901.                 in the expected fashion.
  902.                 The meaning of the third parameter has been
  903.                 expanded.  The parameter may take any of the
  904.                 following values either singly or ORed together:
  905.                       1 --> watch carrier
  906.                       2 --> echo incoming characters
  907.                       4 --> translate cr == cr-lf
  908.                       8 --> buffer remote input & translate backspaces
  909.                 Any other bits set in the parameter are ignored.
  910.                 While in the RSHELL, the remote user has several
  911.                 special key sequences available that will modify the
  912.                 behavior.  Each begins with a Control-Backslash
  913.                 (^\, ascii code 28):
  914.                       ^\e --> toggles echoing of characters
  915.                       ^\x --> toggles cr-crlf translation
  916.                       ^\b --> toggles buffering
  917.                 Anything else following a ^\ is simply passed
  918.                 through unchanged (thus ^\^\ == ^\).  Note that the
  919.                 character codes ARE case sensitive, that is, ^\B is
  920.                 not the same thing as ^\b.  More special codes may
  921.                 be added in the future.
  922.  
  923.  
  924.     SAVEDIRFILE(string)
  925.         Returns: INTEGER, 0 on success or an eror code
  926.         Notes:  Saves the current dialing directory to disk using
  927.                 the filename specified in the parameter.  If the
  928.                 parameter is "" then the file will be saved using
  929.                 its current name.
  930.  
  931.     SAVESCR(void)
  932.         Returns: INTEGER, handle to saved screen information
  933.         Notes:  Saves the current contents of the entire screen and
  934.                 returns a 'handle' to the saved information.  This
  935.                 information includes the current video mode, the
  936.                 cursor position, the cursor size and attribute as
  937.                 well as the actual contents of the screen. If SAVESCR
  938.                 returns zero then there was not sufficient memory
  939.                 to perform the operation.
  940.  
  941.  
  942.     SCROLLBACK(void)
  943.         Returns: INTEGER, TRUE or FALSE
  944.         Notes:  This is equivalent to typing Alt-W from terminal
  945.                 mode.  The function returns TRUE unless the Scroll
  946.                 Back feature is disabled in which case it returns
  947.                 FALSE.
  948.  
  949.  
  950.     SETANSIBS(integer)
  951.         Returns: INTEGER
  952.         Notes: The integer parameter should be either TRUE or FALSE, this
  953.                function sets or clears the "ANSIBackspace" flag.  Returns
  954.                the previous value of the flag.
  955.  
  956.     SETCTSRTS(integer)
  957.         Returns: INTEGER, TRUE or FALSE
  958.         Notes:  Sets the Cts/Rts handling according to the argument:
  959.                         0  -  CTS/RTS both off
  960.                         1  -  CTS on, RTS off
  961.                         2  -  RTS on, CTS off
  962.                         3  -  CTS/RTS both on
  963.                 The function returns TRUE if it was successful.
  964.  
  965.  
  966.     SETCURSOR(integer, integer)
  967.         Returns: INTEGER, TRUE on success, FALSE on error
  968.         Notes:  Places the cursor at (row, column) on the terminal
  969.                 screen. This is direct placement independent of the
  970.                 current terminal emulation.  The origin is (usually)
  971.                 the upper lefthand corner and is (0,0).  If the current
  972.                 terminal emulation is VT100 AND the virtual terminal is
  973.                 in relative cursor addressing mode AND a scroll region
  974.                 is set, this function will obey the VT100 emulation's
  975.                 rules for cursor placement relative to scrolling region.
  976.                 If the requested location is invalid, this function
  977.                 will return FALSE.
  978.  
  979.     SETCURSORSZ(integer, integer)
  980.         Returns: INTEGER, TRUE on success, FALSE on failure
  981.         Notes:  Sets the size of the cursor, the parameters are the
  982.                 top and bottom scan lines for the cursor.  If successful,
  983.                 system global variables CursorTop and CursorBottom are
  984.                 updated.
  985.  
  986.     SETFNKEYFILE(string)
  987.         Returns: INTEGER, 0 on success, 1 on file not found, 2 on read error
  988.         Notes: Loads a new function key definition file.  If the parameter
  989.                is "" then the user will be queried for the file name.
  990.  
  991.     SETMARK(string, special)
  992.         Returns: INTEGER
  993.         Notes:  The string parameter is a dialing directory tag, "special"
  994.                 is TRUE, FALSE, or TOGGLE. This function sets the mark for
  995.                 the queue dialer on the specified dialing directory entry.
  996.                 Returns the OLD state of the mark for that entry (TRUE or
  997.                 FALSE) or -1 if "tag" was not found.
  998.  
  999.     SETNAME(string, string)
  1000.         Returns: INTEGET, TRUE or FALSE
  1001.         Notes: The first paramter is a "tag" to search the currently
  1002.                loaded dialing directory for; if it is "" then it is
  1003.                taken to mean the most recently dialed entry, if it is
  1004.                "#nnn" then it is the "nnn"th directory entry.  The
  1005.                "Name" field in that entry will be set to the value
  1006.                of the second parameter.  Return TRUE on success or
  1007.                FALSE on error.
  1008.  
  1009.     SETPARMS(integer, integer, integer, integer, integer)
  1010.         Returns: INTEGER, TRUE or FALSE
  1011.         Notes:  The arguments are Portnumber, baudrate, parity,
  1012.                 wordlength, and stopbits respectively.  SETPARMS
  1013.                 returns TRUE if it was able to set the specified
  1014.                 parameter configuration.  If it was unsuccessful
  1015.                 NONE of the parameters were changed.  If the port
  1016.                 number changes, the original comm port will be
  1017.                 closed and any active connection severed.  If any
  1018.                 of the parameters are to stay the same either the
  1019.                 appropriate system-global variable should be used
  1020.                 or, alternately a -1 in that position.
  1021.         Examples:
  1022.                 SETPARMS(Port, 2400, 0, 8, 0) sets the current
  1023.                   comm port to 2400 baud, no parity, 8 bit word
  1024.                   length and 1 stop bit.
  1025.                 SETPARMS(-1, 2400, 0, 8, 0) is equivalent to the
  1026.                   previous example.
  1027.                 SETPARMS(-1, 9600, -1, -1, -1) sets the current
  1028.                   comm port to 9600 baud and leaves all other
  1029.                   settings alone.
  1030.                 SETPARMS(Port, 9600, Parity, WordLen, StopBits)
  1031.                   is equivalent to the previous example.
  1032.         Further Notes:
  1033.                 The following is a list of the numbers to use for
  1034.                 setting parity, word length, and stop bits:
  1035.  
  1036.                 Parity:
  1037.                         0  -  no parity
  1038.                         1  -  odd parity
  1039.                         2  -  even parity
  1040.                         3  -  mark parity
  1041.                         4  -  space parity
  1042.  
  1043.                 Word Length:
  1044.                         7  -  7 bit words
  1045.                         8  -  8 bit words
  1046.  
  1047.                 Stop Bits:
  1048.                         0  -  1 stop bit
  1049.                         1  -  1.5 stop bits
  1050.                         2  -  2 stop bits
  1051.  
  1052.  
  1053.     SETPARMS2(string, integer, integer, integer, integer)
  1054.         Returns: INTEGER, TRUE or FALSE
  1055.         Notes: Exactly like SETPARMS() in all respects except that it
  1056.                takes a string argument for the device name instead of an
  1057.                integer 'port number' so it can be used to switch devices
  1058.                with the device name isn't COMx.  (See the SETPARMS for
  1059.                further information)
  1060.  
  1061.  
  1062.     SETPASSWORD(string, string)
  1063.         Returns: INTEGET, TRUE or FALSE
  1064.         Notes:  The first paramter is a "tag" to search the currently
  1065.                 loaded dialing directory for; if it is "" then it is
  1066.                 taken to mean the most recently dialed entry, if it is
  1067.                 "#nnn" then it will mean the "nnn"th entry.  The
  1068.                 "Password" field in that entry will be set to the value
  1069.                 of the second parameter.  Return TRUE on success or
  1070.                 FALSE on error.
  1071.  
  1072.     SETPHONE(string, string)
  1073.         Returns: INTEGET, TRUE or FALSE
  1074.         Notes:  The first paramter is a "tag" to search the currently
  1075.                 loaded dialing directory for; if it is "" then it is
  1076.                 taken to mean the most recently dialed entry, if it is
  1077.                 "#nnn" then it will mean the "nnn"th entry.  The
  1078.                 "Number" field in that entry will be set to the value
  1079.                 of the second parameter.  Return TRUE on success or
  1080.                 FALSE on error.
  1081.  
  1082.     SETSCRIPT(string, string)
  1083.         Returns: INTEGET, TRUE or FALSE
  1084.         Notes:  The first paramter is a "tag" to search the currently
  1085.                 loaded dialing directory for; if it is "" then it is
  1086.                 taken to mean the most recently dialed entry, if it is
  1087.                 "#nnn" then it will mean the "nnn"th entry.  The
  1088.                 "Script" field in that entry will be set to the value
  1089.                 of the second parameter.  Return TRUE on success or
  1090.                 FALSE on error.
  1091.  
  1092.     SETTAG(string, string)
  1093.         Returns: INTEGET, TRUE or FALSE
  1094.         Notes:  The first paramter is a "tag" to search the currently
  1095.                 loaded dialing directory for; if it is "" then it is
  1096.                 taken to mean the most recently dialed entry, if it is
  1097.                 "#nnn" then it will mean the "nnn"th entry.  The
  1098.                 "Tag" field in that entry will be set to the value
  1099.                 of the second parameter.  Return TRUE on success or
  1100.                 FALSE on error.
  1101.  
  1102.     SETXONXOFF(integer)
  1103.         Returns: INTEGER, TRUE or FALSE
  1104.         Notes:  If the argument is zero, XonXoff processing will be
  1105.                 turned off, if the argument is "1" transmit XonXoff
  1106.                 processing will be enabled, if it is "2" receive
  1107.                 XonXoff processing will be enabled, if it is "3" both
  1108.                 transmit and receive XonXoff processing are enabled.
  1109.                 The system-global variable "XonXoff" may be examined
  1110.                 at any time to determine the current state of XonXoff
  1111.                 processing.  The function returns TRUE if it was
  1112.                 successful.
  1113.  
  1114.  
  1115.     SETVT100BKSP(integer)
  1116.         Returns: INTEGER
  1117.         Notes:  Sets the VT100 emulation backspace translation mode.
  1118.                 If the parameter is TRUE then the VT100 eumlation
  1119.                 will treat incoming Backspace characters (ASCII 8)
  1120.                 as destructive backspaces, if FALSE the VT100 backspace
  1121.                 will be non-destructive.  Returns the previous setting
  1122.                 for the VT100 Backspace handling.
  1123.  
  1124.     SETXLATTABLE(string, integer)
  1125.         Returns: INTEGER
  1126.         Notes:  Reads a new character translation table from the
  1127.                 file specified in the first parameter.  If the second
  1128.                 parameter is zero, the new table will replace the
  1129.                 input character translation table, if it is non-zero,
  1130.                 it will replace the output character translation table.
  1131.                 Returns 0 on success or an error code on failure.
  1132.  
  1133.     SENDBREAK(integer)
  1134.         Returns: INTEGER, the value of its argument
  1135.         Notes:  Will transmit a break signal to the port for the
  1136.                 specified duration in milliseconds.  If a zero value
  1137.                 is specified, the current value of the system-global
  1138.                 variable "BreakLen" is used for the duration.
  1139.  
  1140.  
  1141.     SENDBYTE(integer OR string)
  1142.         Returns: INTEGER, TRUE or FALSE
  1143.         Notes:  Sends the byte specified by either the integer
  1144.                 expression or the first character of the string
  1145.                 expression to the port.  If the character is either
  1146.                 Ctrl-S or Ctrl-Q, the byte is transmitted
  1147.                 immediately.  The function returns TRUE if it was
  1148.                 successful.
  1149.  
  1150.  
  1151.     SENDINIT(void)
  1152.         Returns: INTEGER, TRUE or FALSE
  1153.         Notes:  Transmits the string in the system-global variable
  1154.                 "modemInitStrg" to the comm port.  Returns TRUE if
  1155.                 it was successful.
  1156.  
  1157.  
  1158.     SHELL(string, string)
  1159.         Returns: INTEGER
  1160.         Notes:  Executes the program specified in the first argument
  1161.                 sending it the parameters specified in the second.
  1162.                 If the first argument is NULL, the current value of
  1163.                 the system-global variable "ShellCmd" is used unless
  1164.                 it is also NULL in which case CMD.EXE is executed
  1165.                 with no parameters.  If the first argument is NULL,
  1166.                 the second argument is ignored.  The program is
  1167.                 executed synchronously in the foreground, TE/2 is
  1168.                 suspended while in the shell.  TE/2's screen is saved
  1169.                 before and restored after execution.  The return
  1170.                 value of the function is the return code of the
  1171.                 executed program or -1 if an error occurred.
  1172.                 SHELL(NULL, NULL) is equivalent to typing Alt-O from
  1173.                 terminal mode.
  1174.  
  1175.  
  1176.     SLEEP(integer)
  1177.         Returns: INTEGER, the value of its argument
  1178.         Notes:  Suspends execution of TE/2 for the duration in
  1179.                 milliseconds specified in its argument.
  1180.  
  1181.  
  1182.     SNAPSHOT(string)
  1183.         Returns: INTEGER
  1184.         Notes:  Performs the TE/2 SnapShot function saving its results
  1185.                 to the filename indicated in the parameter.  If the
  1186.                 parameter is "" the the screen capture is saved to the
  1187.                 default file name.  Snapshot always appends data to the
  1188.                 output file.  Returns zero on success or an error code
  1189.                 on failure.
  1190.  
  1191.     SPRINTF(string, ... )
  1192.         Returns: STRING
  1193.         Notes:  SPRINTF receives a format string in its first
  1194.                 argument followed by up to 10 additional arguments
  1195.                 that may be either integers or strings. The arguments
  1196.                 are formatted into a string according to rules
  1197.                 specified by embedded commands in the format string.
  1198.                 With the exception of floating point handling and
  1199.                 pointer notation, all of the functionality of the "C"
  1200.                 functions "printf" and "sprintf" are supported by
  1201.                 TE/2's implementation of SPRINTF, the reader is
  1202.                 referred to the C Language library reference manual of
  1203.                 his or her choice for complete definition of all of
  1204.                 the rules regarding format strings.  Here we will note
  1205.                 the following:
  1206.  
  1207.                   All characters from the format string are copied
  1208.                   to the output string with the following exceptions:
  1209.  
  1210.                   If "%s" is encountered in the format string, the
  1211.                   next unexamined parameter is interpreted as a
  1212.                   string an embedded at that point in the output
  1213.                   string.  The notation "%10s" will right justify the
  1214.                   string in a field of 10 spaces at that point in the
  1215.                   output string. "10" is used by way of example, it
  1216.                   may be any decimal number.  The notation "%-10s"
  1217.                   will likewise left justify the string in a field
  1218.                   of 10 spaces.
  1219.  
  1220.                   If "%d" is encountered in the format string, the
  1221.                   next unexamined parameter is interpreted as a
  1222.                   16 bit signed integer and the ascii representation
  1223.                   of it is embedded into the output string at that
  1224.                   point.  "%ld" interprets the numeric parameter as
  1225.                   a 32-bit signed integer (the native form of all
  1226.                   integers in the TE/2 script language).  "%10d" or
  1227.                   "%10ld" right justifies the number in a field of
  1228.                   10 spaces in the output string, "%010d" or "%010ld"
  1229.                   right justify the number in a field of ten zeros
  1230.                   in the output string.
  1231.  
  1232.                   If "%*s", "%-*s", "%*d", et cetera are encountered
  1233.                   in the format string, these will behave exactly the
  1234.                   same as the examples above with numeric values
  1235.                   except that TWO parameters are expected in the
  1236.                   argument list, the first an integer which will
  1237.                   specify the field width, the second the string or
  1238.                   integer to place in the output string.
  1239.  
  1240.                   If "%%" is encountered in the format string, a
  1241.                   single "%" is placed in the output string.
  1242.  
  1243.                 The arguments to SPRINTF may be literal strings,
  1244.                 string variables, string expressions, numeric
  1245.                 literals, constants, variables, or expressions
  1246.                 in any form or order.  The only restriction is that
  1247.                 the first argument, the format string, must evaluate
  1248.                 to a string.
  1249.  
  1250.                 WARNING
  1251.                 It is not possible to type check all of the
  1252.                 parameters in an SPRINTF (or MESSAGE or TRANSMIT)
  1253.                 argument list.  The script file writer is expected
  1254.                 to take precautions to avoid type mismatches so that
  1255.                 integers are not interpreted as strings and vice
  1256.                 versa.  In general, if a string is interpreted as an
  1257.                 integer there should be no ill effects other than
  1258.                 erroneous output.  If an integer is interpreted as
  1259.                 a string however, a protection violation may well
  1260.                 occur.
  1261.  
  1262.         Examples:
  1263.                 SPRINTF("Hello %s", "World")
  1264.                   returns "Hello World"
  1265.  
  1266.                 SPRINTF("Hello %8s", "world")
  1267.                   returns "Hello    world"
  1268.  
  1269.                 SPRINTF("Hello %-8s", "World")
  1270.                   returns "Hello World   "
  1271.  
  1272.                 SPRINTF("This is the %dth example", 4)
  1273.                   returns "This is the 4th example"
  1274.  
  1275.                 SPRINTF("Action is %03d%% %s", 35, "complete")
  1276.                   returns "Action is 035% complete"
  1277.  
  1278.  
  1279.  
  1280.     STATUS(void)
  1281.         Returns: INTEGER, always FALSE
  1282.         Notes:  This is equivalent to typing Alt-I from terminal mode.
  1283.  
  1284.  
  1285.     STREVAL(string)
  1286.         Returns: STRING, the value of its argument
  1287.         Notes:  This function is included as a convenience for the
  1288.                 REXX language script writer, it simply returns the
  1289.                 value of its argument allowing a REXX script to query
  1290.                 any TE/2 internal or global variable.
  1291.  
  1292.     STRCMP(string, string)
  1293.         Returns: INTEGER
  1294.         Notes:  Lexigraphically compares two strings, returns zero if
  1295.                 the strings are identical, less than zero if the
  1296.                 first string is "less than" the second, greater than
  1297.                 zero otherwise.
  1298.  
  1299.  
  1300.     STRGET(string, integer, integer, integer, integer, integer, integer)
  1301.         Returns: STRING, user response
  1302.         Notes:  String input routine.  The string parameter is the
  1303.                 default value, and the integer parameters are, in
  1304.                 order, row for the input, column for the input, width
  1305.                 of the input area, maximum input length (may be larger,
  1306.                 smaller or equal to the previous parameter), attribute
  1307.                 for 'first display' of the default, and attribute for
  1308.                 display while the user is editing/inputting.  Returns
  1309.                 the edited string, returns the empty string if the user
  1310.                 pressed ESCape.
  1311.                 Note that input area is NOT saved and restored, it will
  1312.                 remain on screen after the input.
  1313.  
  1314.  
  1315.     STRICMP(string, string)
  1316.         Returns: INTEGER
  1317.         Notes:  Case-insensitive version of STRCMP.  See STRCMP.
  1318.  
  1319.  
  1320.     STRLEFT(string, integer)
  1321.         Returns: STRING
  1322.         Notes:  Returns the leftmost N characters in the string where
  1323.                 N is the number specified in the second argument.  If
  1324.                 N is greater than the length of the string, the
  1325.                 entire string is returned. (see STRRIGHT, SUBSTR)
  1326.  
  1327.  
  1328.     STRLEN(string)
  1329.         Returns: INTEGER, the length of the string
  1330.  
  1331.  
  1332.     STRNSTR(string, string, integer)
  1333.         Returns: INTEGER
  1334.         Notes:  The integer parameter specifies a match count (n), this
  1335.                 function finds the n-th occurance of the second string
  1336.                 in the first.  STRNSTR(s1, s2, 1) is identical to
  1337.                 STRSTR(s1, s2).
  1338.  
  1339.     STRPUT(integer, integer, integer, string, ... )
  1340.         Returns: INTEGER, length of displayed string
  1341.         Notes:  The integer parameters are, in order, screen row,
  1342.                 screen column, and attribute for display.  The
  1343.                 string is a format string (see SPRINTF) which may
  1344.                 be followed by up to ten additional arguments.
  1345.                 The resulting string is placed at the indicated
  1346.                 position on screen using the indicated attribute.
  1347.                 Return value is the length of the displayed string.
  1348.  
  1349.  
  1350.     STRRIGHT(string, integer)
  1351.         Returns: STRING
  1352.         Notes:  Returns the rightmost N characters in the string where
  1353.                 N is the number specified in the second argument.  If
  1354.                 N is greater than the length of the string, the
  1355.                 entire string is returned. (see STRLEFT, SUBSTR)
  1356.  
  1357.  
  1358.     STRSTR(string, string)
  1359.         Returns: INTEGER
  1360.         Notes:  Scans the string in the first argument for an
  1361.                 occurrence of the string in the second.  Returns zero
  1362.                 if the string was not found else it returns the
  1363.                 position of the second string in the first.
  1364.  
  1365.  
  1366.     STRTRIM(string)
  1367.         Returns: STRING
  1368.         Notes:  Returns a string which is a copy of the string in
  1369.                 its argument with all leading space, tab, carriage
  1370.                 return, and newline characters removed from the
  1371.                 beginning and end.  Embedded spaces, etc., are not
  1372.                 removed.
  1373.  
  1374.  
  1375.     SUBSTR(string, integer, integer)
  1376.         Returns: STRING
  1377.         Notes:  Returns a substring of the string in its argument.
  1378.                 If N is the value of the second argument and M the
  1379.                 value of the third, SUBSTR returns the string which
  1380.                 begins N characters into the first argument and
  1381.                 continues for M characters.  If N is greater than the
  1382.                 length of the string, the empty string is returned,
  1383.                 if N+M is greater than the length of the string, only
  1384.                 the characters in the string from position N to the
  1385.                 end of the string are returned. (see STRLEFT and
  1386.                 STRRIGHT)
  1387.  
  1388.  
  1389.     TERMECHO(special)
  1390.         Returns: INTEGER, TRUE or FALSE
  1391.         Notes:  The special argument must be one of TRUE, FALSE, or
  1392.                 TOGGLE.  TERMECHO will enable or disable the echoing
  1393.                 of characters to the terminal screen.  This effects
  1394.                 both incoming characters from the comm port received
  1395.                 during a WAITFOR, MUXWAIT, RGETS, or RGETC and
  1396.                 characters typed at the keyboard during a GETS call.
  1397.                 It does NOT have any effect on characters received
  1398.                 during a main or higher level PROCESS.
  1399.         Example:
  1400.                 message("Enter string to wait for:")
  1401.                 termecho(FALSE)
  1402.                 waitSrch = gets(255)  ; no screen echo here
  1403.                 waitfor(waitSrch, 60) ; or here
  1404.                 process               ; screen will update during this
  1405.                                       ; but will still be off when we
  1406.                                       ; get back
  1407.  
  1408.  
  1409.     TERMWINDOW(integer, integer, integer, integer)
  1410.         Returns: INTEGER, TRUE on success, FALSE on error
  1411.         Notes:  The parameters specify, in order: row, columns, number
  1412.                 of rows, and number of columns for the new emulation
  1413.                 window.  This function resets the terminal window (a
  1414.                 subset of the physical screen) to the size and location
  1415.                 specified.  It's recommended that you perform a CLS()
  1416.                 before and after this call.  Take great care with this
  1417.                 one, it's a direct back door into the terminal emulation
  1418.                 handler.
  1419.  
  1420.     TOLOWER(string)
  1421.         Returns: STRING
  1422.         Notes:  Returns a string which is a copy of its argument
  1423.                 with all upper case letters translated to lower case.
  1424.                 (see TOUPPER)
  1425.  
  1426.  
  1427.     TOUPPER(string)
  1428.         Returns: STRING
  1429.         Notes:  Returns a string which is a copy of its argument
  1430.                 with all lower case letters translated to upper case.
  1431.                 (see TOLOWER)
  1432.  
  1433.  
  1434.     TRACE(integer)
  1435.         Returns: INTEGER, the value of its argument
  1436.         Notes:  Enables and disables trace mode during script file
  1437.                 execution.  When in trace mode each line of the
  1438.                 script file is printed on the terminal display (and
  1439.                 will appear in the scroll back buffer and log file
  1440.                 if one is open) as it is encountered.  This is a
  1441.                 global toggle, once turned on it is on for all
  1442.                 subsequent script file processing until it is turned
  1443.                 off again or until TE/2 ends.
  1444.  
  1445.  
  1446.     TRANSMIT(string, ... )
  1447.         Returns: INTEGER, the length of the message string
  1448.         Notes:  TRANSMIT takes a parameter list identical to the
  1449.                 SPRINTF function, refer to SPRINTF for a more
  1450.                 complete discussion of the format string and its
  1451.                 arguments.  This function will build a string
  1452.                 according to the rules for SPRINTF and transmit
  1453.                 it to the comm port.
  1454.  
  1455.  
  1456.     UNIQUEFNAME(string)
  1457.         Returns: STRING
  1458.         Notes:  Creates a temporary file name based on 'template' which
  1459.                 is a basename plus wildcard characters '?'.  For example:
  1460.                 C:\TEMP\FILE????.  The function does NOT open the file.
  1461.                 Returns the empty string if no new names could be generated.
  1462.  
  1463.     UPLOAD(special, string)
  1464.         Returns: INTEGER, TRUE or FALSE
  1465.         Notes:  The "special" parameter must be one of the following
  1466.                 pre-defined constants: ASCII, XMODEM, XMODEM1K,
  1467.                 YMODEM, YMODEMG, ZMODEM, or QUERY.  If this parameter
  1468.                 is QUERY, the user is prompted for the protocol.  The
  1469.                 second parameter is the file name, if it is the empty
  1470.                 string, the user is prompted for the file name.
  1471.                 The function returns TRUE if the file transfer ended
  1472.                 with no fatal errors.  (See DOWNLOAD)
  1473.  
  1474.  
  1475.     WAITFOR(string, integer)
  1476.         Returns: INTEGER, TRUE or FALSE
  1477.         Notes:  Does not return until either the string specified in
  1478.                 the first parameter is encountered at the comm port,
  1479.                 the duration in seconds specified in the second
  1480.                 parameter has elapsed, or the user types ESCape,
  1481.                 whichever occurs first.  Returns TRUE if the string
  1482.                 was encountered, FALSE if a timeout occurred or the
  1483.                 wait was aborted by typing ESCape.
  1484.                 Note that specifying a number less than zero as the
  1485.                 timeout parameter, timeout processing is disabled.
  1486.                 Incoming characters are echoed to the terminal screen
  1487.                 unless terminal display is turned off, the log file
  1488.                 is maintained.  (See MUXWAIT, WATCHFOR)
  1489.  
  1490.  
  1491.     WATCHFOR(string, string)
  1492.         Returns: INTEGER, 'handle' for installed watch
  1493.         Notes:  Unlike WAITFOR, which does not return until the
  1494.                 indicated string has been encountered or a set period
  1495.                 of time has elapsed, WATCHFOR installs an asynchronous
  1496.                 'watch' and returns immediately.  The return value is
  1497.                 zero if TE/2 could not install this watch, only 10
  1498.                 watches may be active at any time.  If successful,
  1499.                 the return value is a 'handle' which you will
  1500.                 need to pass to CANCELWATCH when you want to end
  1501.                 the watch.  This handle is therefore every bit as
  1502.                 precious as the handle returned from FOPEN and the
  1503.                 warnings given below in the notes about file handles
  1504.                 apply equally well to watch handles.
  1505.                 The first parameter is the string to 'watch' for.
  1506.                 The second parameter may be nearly any valid TE/2
  1507.                 Script Language assignment statement or function
  1508.                 call.  The statement is not checked for proper syntax
  1509.                 or variable usage until the watch string has been
  1510.                 matched and TE/2 attempts to execute the statement so
  1511.                 you must take care that the syntax is correct and
  1512.                 that any variables referred to in the statement will
  1513.                 be accessible when the statement is to be executed.
  1514.                 Global and system-global variables are always safe
  1515.                 but local variables will cause problems if the watch
  1516.                 is left to continue after the current script has
  1517.                 finished execution or during the execution of any
  1518.                 nested script files or recursive PROCESSes.
  1519.                 Every incoming character from the com port is checked
  1520.                 against the currently active watches, if a watch
  1521.                 string is matched it is tagged for execution.  If
  1522.                 TE/2 is in a process loop at the time, it will be
  1523.                 immediately executed.  However, if a script file
  1524.                 is running at the time, it will not execute until
  1525.                 the current line has finished execution - this means
  1526.                 that a WAITFOR, MUXWAIT, RGETS, RGETC, etc., will not
  1527.                 be interrupted to execute a watch command.
  1528.                 Use the function CANCELWATCH to release a watch that
  1529.                 is no longer needed. (See CANCELWATCH)
  1530.         Example:
  1531.  
  1532.                 integer whand1
  1533.                 integer whand2
  1534.                 integer gotMail = FALSE
  1535.  
  1536.                 program
  1537.                   whand1 = watchfor("ENTER to continue", "sendbyte(13)")
  1538.                   whand2 = watchfor("mail waiting", "gotMail = TRUE")
  1539.                   waitfor("Enter your choice:", 120)
  1540.                   cancelwatch(whand1)
  1541.                   cancelwatch(whand2)
  1542.                   if gotMail
  1543.                     ; et cetera
  1544.  
  1545.  
  1546.  
  1547.     WINDOWMINMAX(integer)
  1548.         Returns: INTEGER, 0 on success or an error value
  1549.         Notes: Sets TE/2's window state.  The integer parameter should be
  1550.                one of:
  1551.                   0 -> Minimize
  1552.                   1 -> Maximize
  1553.                   2 -> Restore
  1554.                This function not available if TE/2 is running in full
  1555.                screen mode
  1556.